package com.caixin.common.enums;

/**
 * @description: 微信账号类型
 * @author: caixin
 * @date: 2021/11/21 18:10
 * @param: null
 * @return:
 */
public enum WeChatTypeEnum {
    PERSONAL_NO("1", "个人号"),
    SUBSCRIBE_NO("2", "订阅号"),
    SERVICE_NO("3","服务号"),
    GROUP("4", "微信群");

    private String name ;
    private String code ;

    private WeChatTypeEnum( String code , String name){
        this.code = code ;
        this.name = name ;
    }
    public String getName() {
        return name;
    }
    public String getCode() {
        return code;
    }

    /**
     * @description: 根据code获取枚举
     * @author: caixin
     * @date: 2021/11/20 23:46
     * @param: code
     * @return: com.domain.common.enums.SysConfigEnum
     */
    public static WeChatTypeEnum getByCode(String code) {
        for (WeChatTypeEnum e : WeChatTypeEnum.values()) {
            if (code.equalsIgnoreCase(e.getCode())) {
                return e;
            }
        }
        return null;
    }
}
